/**
 * @file main_greedy.cpp
 * @brief 用贪心算法算法解决硬币找零问题。
 */
#include<iostream>
#include "coin.h"
int main(){
	int s[4];
	int n;
	cin>>s[0]>>s[1]>>s[2]>>s[3]>>n;
	int ans=greedy(s,n);
	if(ans==INF) cout<<"Not possible"<<endl;
	else cout<<ans<<endl;
	return 0;
}